; prolog.asm
; Basic start code & time initialisation

	.include "vicrom.inc"

	.import detect3k	

	.segment "BASIC"

; Startup Basic program "2011 SYS main"
			.word	basprg
basprg:		.word	@end
			.word	2011
			.byte	$9E
			.byte	<(detect_main / 1000 .mod 10) + $30
			.byte	<(detect_main / 100 .mod 10) + $30
			.byte	<(detect_main / 10 .mod 10) + $30
			.byte	<(detect_main / 1 .mod 10) + $30
			.byte	0
@end:		.word	0

	.segment "CODE"
	
detect_main:	
			jsr detect3k
			beq @found
			lda #<not_str
			ldy #>not_str
			jmp STROUT
@found:		lda #<det_str
			ldy #>det_str
			jmp STROUT
			

	.segment "RODATA"
	
not_str:
		.byte "no "
det_str:
		.byte "internal 3k found!", 13, 0
